from threading import Thread


def task(count: int):
    for i in range(count):
        print(i)


thread1 = Thread(target=task, args=(10,))
thread2 = Thread(target=task, args=(20,))

thread1.start()
thread2.start()
thread1.join()
thread2.join()
print("main thread is end")  # 执行到此处，主线程无任务，自行结束
